added samples
[windows-sources.git] / sdk / samples / all in on code / Visual Studio 2010 / VBASPNETDisplayAddtionalTextInCalendar / My Project / MyExtensions / MyWebExtension.vb
blobf8b4bf5d568273b9c58fadc4a0b776b938687cba
1 #If _MyType <> "Empty" Then
3 Namespace My
4 ''' <summary>
5 ''' Module used to define the properties that are available in the My Namespace for Web projects.
6 ''' </summary>
7 ''' <remarks></remarks>
8 <Global.Microsoft.VisualBasic.HideModuleName()> _
9 Module MyWebExtension
10 Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.ServerComputer)
11 Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.WebUser)
12 Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.AspLog)
13 Private s_Application As New ThreadSafeObjectProvider(Of MyApplication)
15 ''' <summary>
16 ''' Returns information about the current application.
17 ''' </summary>
18 <Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
19 Friend ReadOnly Property Application() As MyApplication
20 Get
21 Return s_Application.GetInstance()
22 End Get
23 End Property
25 ''' <summary>
26 ''' Returns information about the host computer.
27 ''' </summary>
28 <Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
29 Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.ServerComputer
30 Get
31 Return s_Computer.GetInstance()
32 End Get
33 End Property
34 ''' <summary>
35 ''' Returns information for the current Web user.
36 ''' </summary>
37 <Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
38 Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.WebUser
39 Get
40 Return s_User.GetInstance()
41 End Get
42 End Property
43 ''' <summary>
44 ''' Returns Request object.
45 ''' </summary>
46 <Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
47 <Global.System.ComponentModel.Design.HelpKeyword("My.Request")> _
48 Friend ReadOnly Property Request() As Global.System.Web.HttpRequest
49 <Global.System.Diagnostics.DebuggerHidden()> _
50 Get
51 Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current
52 If CurrentContext IsNot Nothing Then
53 Return CurrentContext.Request
54 End If
55 Return Nothing
56 End Get
57 End Property
58 ''' <summary>
59 ''' Returns Response object.
60 ''' </summary>
61 <Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
62 <Global.System.ComponentModel.Design.HelpKeyword("My.Response")> _
63 Friend ReadOnly Property Response() As Global.System.Web.HttpResponse
64 <Global.System.Diagnostics.DebuggerHidden()> _
65 Get
66 Dim CurrentContext As Global.System.Web.HttpContext = Global.System.Web.HttpContext.Current
67 If CurrentContext IsNot Nothing Then
68 Return CurrentContext.Response
69 End If
70 Return Nothing
71 End Get
72 End Property
73 ''' <summary>
74 ''' Returns the Asp log object.
75 ''' </summary>
76 <Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
77 Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.AspLog
78 <Global.System.Diagnostics.DebuggerHidden()> _
79 Get
80 Return s_Log.GetInstance()
81 End Get
82 End Property
84 ''' <summary>
85 ''' Provides access to WebServices added to this project.
86 ''' </summary>
87 <Global.System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")> _
88 <Global.System.ComponentModel.Design.HelpKeyword("My.WebServices")> _
89 Friend ReadOnly Property WebServices() As MyWebServices
90 <Global.System.Diagnostics.DebuggerHidden()> _
91 Get
92 Return m_MyWebServicesObjectProvider.GetInstance()
93 End Get
94 End Property
96 <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
97 <Global.Microsoft.VisualBasic.MyGroupCollection("System.Web.Services.Protocols.SoapHttpClientProtocol", "Create__Instance__", "Dispose__Instance__", "")> _
98 <Global.System.Runtime.CompilerServices.CompilerGenerated()> _
99 Friend NotInheritable Class MyWebServices
101 <Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never), Global.System.Diagnostics.DebuggerHidden()> _
102 Public Overrides Function Equals(ByVal o As Object) As Boolean
103 Return MyBase.Equals(o)
104 End Function
105 <Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never), Global.System.Diagnostics.DebuggerHidden()> _
106 Public Overrides Function GetHashCode() As Integer
107 Return MyBase.GetHashCode
108 End Function
109 <Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never), Global.System.Diagnostics.DebuggerHidden()> _
110 Friend Overloads Function [GetType]() As Global.System.Type
111 Return GetType(MyWebServices)
112 End Function
113 <Global.System.ComponentModel.EditorBrowsable(Global.System.ComponentModel.EditorBrowsableState.Never), Global.System.Diagnostics.DebuggerHidden()> _
114 Public Overrides Function ToString() As String
115 Return MyBase.ToString
116 End Function
118 <Global.System.Diagnostics.DebuggerHidden()> _
119 Private Shared Function Create__Instance__(Of T As {New})(ByVal instance As T) As T
120 If instance Is Nothing Then
121 Return New T()
122 Else
123 Return instance
124 End If
125 End Function
127 <Global.System.Diagnostics.DebuggerHidden()> _
128 Private Sub Dispose__Instance__(Of T)(ByRef instance As T)
129 instance = Nothing
130 End Sub
132 <Global.System.Diagnostics.DebuggerHidden()> _
133 <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
134 Public Sub New()
135 MyBase.New()
136 End Sub
137 End Class
139 <Global.System.Runtime.CompilerServices.CompilerGenerated()> Private ReadOnly m_MyWebServicesObjectProvider As New ThreadSafeObjectProvider(Of MyWebServices)
140 End Module
142 <Global.System.Runtime.CompilerServices.CompilerGenerated(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> Partial Friend Class MyApplication
143 Inherits Global.Microsoft.VisualBasic.ApplicationServices.ApplicationBase
144 End Class
146 End Namespace
148 #End If